package cn.powerone.scm.service.impl;

import java.util.List;
import cn.powerone.common.utils.DateUtils;
import cn.powerone.scm.domain.ScmSupplierOrderItemsWithOrderInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.powerone.scm.mapper.ScmSupplierOrderItemsMapper;
import cn.powerone.scm.domain.ScmSupplierOrderItems;
import cn.powerone.scm.service.IScmSupplierOrderItemsService;

/**
 * 供应商订单明细Service业务层处理
 * 
 * @author PowerOne
 * @date 2025-07-04
 */
@Service
public class ScmSupplierOrderItemsServiceImpl implements IScmSupplierOrderItemsService 
{
    @Autowired
    private ScmSupplierOrderItemsMapper scmSupplierOrderItemsMapper;

    /**
     * 查询供应商订单明细
     * 
     * @param itemId 供应商订单明细主键
     * @return 供应商订单明细
     */
    @Override
    public ScmSupplierOrderItems selectScmSupplierOrderItemsByItemId(Long itemId)
    {
        return scmSupplierOrderItemsMapper.selectScmSupplierOrderItemsByItemId(itemId);
    }

    /**
     * 查询供应商订单明细列表
     * 
     * @param scmSupplierOrderItems 供应商订单明细
     * @return 供应商订单明细
     */
    @Override
    public List<ScmSupplierOrderItems> selectScmSupplierOrderItemsList(ScmSupplierOrderItems scmSupplierOrderItems)
    {
        return scmSupplierOrderItemsMapper.selectScmSupplierOrderItemsList(scmSupplierOrderItems);
    }

    /**
     * 新增供应商订单明细
     * 
     * @param scmSupplierOrderItems 供应商订单明细
     * @return 结果
     */
    @Override
    public int insertScmSupplierOrderItems(ScmSupplierOrderItems scmSupplierOrderItems)
    {
        scmSupplierOrderItems.setCreateTime(DateUtils.getNowDate());
        return scmSupplierOrderItemsMapper.insertScmSupplierOrderItems(scmSupplierOrderItems);
    }

    /**
     * 修改供应商订单明细
     * 
     * @param scmSupplierOrderItems 供应商订单明细
     * @return 结果
     */
    @Override
    public int updateScmSupplierOrderItems(ScmSupplierOrderItems scmSupplierOrderItems)
    {
        scmSupplierOrderItems.setUpdateTime(DateUtils.getNowDate());
        return scmSupplierOrderItemsMapper.updateScmSupplierOrderItems(scmSupplierOrderItems);
    }

    /**
     * 批量删除供应商订单明细
     * 
     * @param itemIds 需要删除的供应商订单明细主键
     * @return 结果
     */
    @Override
    public int deleteScmSupplierOrderItemsByItemIds(Long[] itemIds)
    {
        return scmSupplierOrderItemsMapper.deleteScmSupplierOrderItemsByItemIds(itemIds);
    }

    /**
     * 删除供应商订单明细信息
     * 
     * @param itemId 供应商订单明细主键
     * @return 结果
     */
    @Override
    public int deleteScmSupplierOrderItemsByItemId(Long itemId)
    {
        return scmSupplierOrderItemsMapper.deleteScmSupplierOrderItemsByItemId(itemId);
    }

    @Override
    public List<ScmSupplierOrderItemsWithOrderInfoVO> selectScmSupplierOrderItemsListWithOrderInfo(ScmSupplierOrderItemsWithOrderInfoVO scmSupplierOrderItems) {
        return scmSupplierOrderItemsMapper.selectScmSupplierOrderItemsListWithOrderInfo(scmSupplierOrderItems);
    }
}
